

#ifndef USER_UART_SERIAL_H
#define USER_UART_SERIAL_H
typedef struct
{
	volatile  uint8_t user_recvstart;
	volatile  uint8_t user_recvend;
	uint8_t  *user_recvbuff;
	uint16_t  user_recvbuff_len;
}USER_UART_SERIAL_T;


int user_uart_serial_get_datalength(USER_UART_SERIAL_T *user_uart_serial_handle);
int user_uart_serial_check_data(USER_UART_SERIAL_T *user_uart_serial_handle,uint8_t* data,uint16_t len);
int user_uart_serial_get_data(USER_UART_SERIAL_T *user_uart_serial_handle,uint8_t* data,uint16_t len);
void user_uart_serial_end_add1(USER_UART_SERIAL_T *user_uart_serial_handle );
void user_uart_serial_init(USER_UART_SERIAL_T *user_uart_serial_handle);
void user_uart_serial_add_data(USER_UART_SERIAL_T *user_uart_serial_handle,uint8_t data);

uint16_t CRC16 (const uint8_t *nData, uint16_t wLength);




#endif /* USER_UART_SERIAL_H */
